﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'GetUbigeoIDByDPD')
	BEGIN
		PRINT 'DROP  Procedure  GetUbigeoIDByDPD'
		DROP  Procedure  GetUbigeoIDByDPD
	END
GO

PRINT 'CREATE Procedure GetUbigeoIDByDPD'
GO

CREATE Procedure GetUbigeoIDByDPD

	(
		@intUbigeoID int OUTPUT
		,@intDepartamentoID int
		,@intProvinciaID int
		,@intDistritoID int
	)

AS

BEGIN

	SET @intUbigeoID = (SELECT IdUbigeo FROM UBIGEO WHERE IdDepartamento = @intDepartamentoID  AND IdProvincia = @intProvinciaID AND idDistrito = @intDistritoID)

END

GO


GRANT EXEC ON GetUbigeoIDByDPD TO PUBLIC

GO


